import request from '@/utils/request'

// 获取模型详情
export function getTaskModelDetail(params) {
  let url = params.dmslId ? '/sand/getCenterResult' : '/sand/getAhpFinalResult'
  // let url = params.dmslId ? '/sand/getCenterResult' : '/sand/getFinalResult'
  return request({
    url,
    method: 'get',
    params
  })
}

// 查看任务
export function detailTask(query) {
  return request({
    url: '/preAssessTask/findById',
    method: 'get',
    params: query
  })
}

// 获取中间结果
export function getDzzhTaskModel(query) {
  return request({
    url: '/sand/getCenterDataPage',
    method: 'get',
    params: query
  })
}
// 获取坡度数据版本
export function getSlopeData(query) {
  return request({
    url: '/softSoil/versionPage',
    method: 'get',
    params: query
  })
}


// 存为中间结果
export function saveAsMiddleResult(data) {
  return request({
    url: '/sand/saveToCenterResult',
    method: 'post',
    data: data
  })
}

// 替换为最终结果
export function replaceFinalResult(data) {
  return request({
    url: '/sand/saveToFinalResult',
    method: 'post',
    data: data
  })
}

// 删除
export function deleteCenter(data) {
  return request({
    url: '/sand/delCenterResult',
    method: 'post',
    data: data
  })
}
// 计算综合地形指数
export function count1(params) {
  return request({
    url: '/sand/calculateOmprehensiveTerrainIndex',
    method: 'get',
    params
  })
}
// 计算场地类别
export function count2(params) {
  return request({
    url: '/sand/calculateLandForm',
    method: 'get',
    params
  })
}
// 评估计算
export function count(data) {
  return request({
    url: '/sand/evaluate1',
    method: 'post',
    data: data
  })
}
// 评估计算
export function handleRiver(data) {
  return request({
    url: '/sand/handleRiver',
    method: 'post',
    data: data
  })
}

// 为任务保存选择的钻孔数据版本
export function selectVersionCode(data) {
  return request({
    url: '/sand/chooseDrillData',
    method: 'post',
    data: data
  })
}

export function getEvaluateResult(query) {
  return request({
    url: '/sand/getEvaluateResult',
    method: 'get',
    params: query
  })
}
export function getDetails(query) {
  return request({
    url: '/sand/details',
    method: 'get',
    params: query
  })
}
export function getAltitudeData(query) {
  return request({
    url: '/basic/versionList',
    method: 'get',
    params: query
  })
}
//更换模型
export function replaceFinalModel(data) {
  return request({
    url: '/sand/changeModel',
    method: 'post',
    data: data
  })
}

// 按省统计危险性面积--【砂土液化-层次分析法】
export function countResultAreaByProvince(data) {
  return request({
    url: '/sand/countResultAreaByProvince',
    method: 'post',
    data: data
  })
}

// 按市统计危险性面积--【砂土液化-层次分析法】
export function countResultAreaByCity(data) {
  return request({
    url: '/sand/countResultAreaByCity',
    method: 'post',
    data: data
  })
}